home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / editors / fixtx611.zip / FIXTEXT.DOC < prev    next >
Text File  |  1996-11-30  |  15KB  |  316 lines

  1. FIXTEXT.DOC                          1                         Revised: 11-30-96
  2.  
  3. The FIXTEXT.EXE program applies a character-translation template to  any  entire
  4. text file.  This allows you to change a  whole  bunch  of  characters  at  once.
  5. Features:
  6.  
  7.   * Can process text files of any size.
  8.   * Can process DOS text files (lines ending with CR/LF), Mac text files
  9.     (lines ending with CR), Unix text files (lines ending with LF), and fixed
  10.     length files (lines of a fixed length without any CR or LF characters).
  11.   * Can convert any of the above four types of text files to any of the
  12.     other types of text files.
  13.   * Automatically detects the type of input file if it's a standard text
  14.     file (lines ending with CR/LF, CR alone, or LF alone).
  15.   * Ideal utility to convert all Unix text files to DOS text files.
  16.   * Can be used on binary files but using the /REPLACE option isn't exactly
  17.     recommended in this case...
  18.   * Can load a user-defined character-translation tables.
  19.   * Character-translation tables can let you do things like:
  20.       - Convert all lowercase characters to uppercase characters
  21.       - Translate IBM graphics characters into standard ASCII text characters;
  22.         this is very useful if you want to print the document and are tired of
  23.         getting weird stuff printing out.
  24.   * Can translate tab characters into spaces.
  25.   * Can fix up underscores and other backspace characters.
  26.   * Can remove leading and/or trailing spaces from lines.
  27.   * Can remove blank lines from files.
  28.   * Can create a file showing all lines that were changed.
  29.   * Can translate single characters into multiple characters or remove them
  30.     entirely.
  31.   * The input file specification can include standard DOS wildcards or an
  32.     external file (@listfile) containing the files to be processed (although
  33.     either prohibits specifying an output file name).
  34.  
  35.  
  36. Specifying parameters:
  37.  
  38. Parameters for this program can be set in the following ways.  The last  setting
  39. encountered always wins:
  40.   - Read from an *.INI file (see BRUCEINI.DOC file),
  41.   - Through the use of an environmental variable (SET FIXTEXT=whatever), or
  42.   - From the command line (see "Syntax" below)
  43.  
  44.  
  45.  
  46. FIXTEXT.DOC                          2                         Revised: 11-30-96
  47.  
  48. The character translation file (lookup tables):
  49.  
  50. FIXTEXT will process a character-translation (lookup) table  if  one  is  found.
  51. This table can be in your standard *.INI file (e.g. FIXTEXT.INI) if  desired  or
  52. it can be a separate file specified using the /Linitfile parameter.
  53.  
  54. A sample FIXTEXT.INI file is provided.  You can modify this file or create  your
  55. own.
  56.  
  57. If no *.INI file is found (or if "/-I" or "/INULL" is  specified),  the  default
  58. translation table will be  loaded.   This  one  is  identical  to  the  original
  59. FIXTEXT.INI file and has these characteristics:
  60.  
  61.   - All characters in the decimal 032 to 125 range are left unchanged
  62.   - Characters in decimal 24 to 27, and 176 to 223 are considered graphics
  63.     characters and are translated into regular text characters, typically
  64.     ".", "X", "x", "|", "-", and "+"
  65.   - Decimal characters 248 to 250 and 254 are changed into asterisks ("*")
  66.   - All other characters are translated into spaces
  67.  
  68. As an example of the graphics character translation that's done, the following:
  69.  
  70.          ┌─┬─┐   ╔═╦═╗                      +-+-+   +-+-+
  71.          │ │ │   ║ ║ ║                      | | |   | | |
  72.          ├─┼─┤   ╠═╬═╣        becomes:      +-+-+   +-+-+
  73.          │ │ │   ║ ║ ║                      | | |   | | |
  74.          └─┴─┘   ╚═╩═╝                      +-+-+   +-+-+
  75.  
  76. It may not look as good but it certainly prints better on most printers.
  77.  
  78. The lookup table is an ASCII text file which consists of a series  of  lines  in
  79. the following format:
  80.  
  81.         inchar = outstr
  82.  
  83. where "inchar" is the character to change from and "outstr" is  what  to  change
  84. the character to.  Both portions can consist of  regular  non-space  ASCII  text
  85. characters (like "A" or "z") as well as hexadecimal values (in the form &Hxx) or
  86. decimal values (in the  form  \nnn).   "outstr"  can  consist  of  0  (the  word
  87. "(NONE)"), 1, or 2 or  more  replacement  characters  while  "inchar"  can  only
  88. represent a single character.  You cannot use a space or equal  sign  in  either
  89. "inchar" or "outstr"; use the hexadecimal or  decimal  representations  instead.
  90. The table does not have to be in any specified order.  Lines can end  with  "/*"
  91. followed by a comment if you want.
  92.  
  93. Hexadecimal and decimal equivalents are explained in BRUCEHEX.DOC.
  94.  
  95.  
  96. FIXTEXT.DOC                          3                         Revised: 11-30-96
  97.  
  98. Examples:
  99.  
  100.         a    = A /* Translate lowercase "a" into capital "A"
  101.         \032 = _ /* Translate space (decimal 032, &H20 too) into underscore
  102.         &H0c = <PAGE>\013\010 /* Translate page eject character into chars
  103.                               /* "<PAGE>" followed by carriage return/line feed
  104.         \027 = \032    /* Translate escape character to a space
  105.         \027 = (NONE)  /* Remove excape characters entirely
  106.  
  107. Since lines beginning with "/" are treated as command-line  defaults,  you  must
  108. use \047 or &H2F if you want to override the definition of "/".
  109.  
  110. Note that when characters are not translated into single characters, all of  the
  111. single-character  translations  are  performed  first  and  then  the  remaining
  112. translations are performed in the order they were specified.  So something  like
  113. the following would result in some lines being changed twice:
  114.  
  115.         A = CAPITAL_A
  116.         a = A
  117.  
  118. In this case, all lowercase "a" characters would first  be  translated  into  an
  119. uppercase "A", and then the same character would then  be  translated  into  the
  120. string "CAPITAL_A".
  121.  
  122.  
  123.  
  124. FIXTEXT.DOC                          4                         Revised: 11-30-96
  125.  
  126. Syntax:
  127.  
  128.     FIXTEXT { filespec | @listfile }
  129.       { outspec [ /OVERWRITE | /-OVERWRITE | /OVERASK ] | /REPLACE }
  130.       [ /n ] [ /TO CRLF | /TO CR | /TO LF | /TO n ] [ /TEXT | /BINARY ]
  131.       [ /TRIM | /RTRIM | /LTRIM | /-TRIM ] [ /ZAPNULL ] [ /-FIXBS ] [ /-FIXTAB ]
  132.       [ /EJECT=str ] [ /Frptfile | /-F ] [ /-EOF ]
  133.       [ /MONO ] [ /Iinitfile | /-I ] [ /Linitfile | /-L ] [ /Q ] [ /? ] [ /?&H ]
  134.  
  135. "filespec" is the input file specification to process.   Can  include  path  and
  136. wildcard information if desired.
  137.  
  138. "@listfile" allows you to have a variety of file specifications saved in a  text
  139. file named "listfile".  Each line  in  the  file  should  consist  of  one  file
  140. specification, each of which can include a path and wildcards if desired.  Blank
  141. lines and lines beginning with semi-colons, colons, or quotes are ignored.
  142.  
  143. "outspec" is the name of the file to create.  It can include a  drive  and  path
  144. specification.  You have to specify either an outspec or the /REPLACE option. If
  145. your input specification includes more than one file name  (either  through  the
  146. use of wildcards or else by using the @listfile option), "outspec"  must  be  an
  147. output file path, not an individual file name.   Otherwise,  it  has  to  be  an
  148. individual file name.
  149.  
  150. "/OVERWRITE" says to overwrite the output file if it exists already.
  151.  
  152. "/-OVERWRITE" says to abort if the output file exists already.
  153.  
  154. "/OVERASK" says to prompt if  the  output  file  exists  already;  this  is  the
  155. default.
  156.  
  157. "/REPLACE" says to write the results to a temporary file  and,  if  the  program
  158. finds characters to change and runs successfully, to replace the  original  file
  159. with the fixed temporary  file.   The  original  file  is  renamed  with  a  BAK
  160. extension if you use this option.  You have to specify *either* an  output  file
  161. name or the /REPLACE option.
  162.  
  163. "/n" specifies that the input file doesn't have any carriage return or line feed
  164. indicators at all and that, in fact, lines are all fixed  length.   The  routine
  165. automatically detects the standard text files (lines end with CR/LF,  CR  alone,
  166. or LF alone); only fixed-length input files require this parameter.
  167.  
  168. "/TO=CRLF" specifies that the output lines are to  end  with  the  standard  DOS
  169. CR/LF combination.
  170.  
  171. "/TO=CR" specifies that the output lines are to end with  the  standard  Mac  CR
  172. character only.
  173.  
  174. "/TO=LF" specifies that the output lines are to end with the  standard  Unix  LF
  175. character only.
  176.  
  177. "/TO n" specifies that the output lines  are  to  be  written  as  fixed  length
  178. records of line length n.
  179.  
  180.  
  181. FIXTEXT.DOC                          5                         Revised: 11-30-96
  182.  
  183. "/TEXT" specifies that the file is a text file with definite lines.
  184.  
  185. "/BINARY" says you want to process a binary file, with no definable lines.  This
  186. is sometimes useful when you have a file in  a  native  word  processing  format
  187. (like a WordPerfect file) and you want to dump it out  as  ASCII  text.   You'll
  188. lose   the   paragraph   breaks   (unless   you're   pretty   good   with    the
  189. character-translation file but you'll get something at least.  Invoking  /BINARY
  190. automatically invokes /-TRIM, /-ZAPNULL, /-FIXBS, and /-FIXTAB.
  191.  
  192. "/TRIM" says to remove all leading and trailing spaces from the lines. Initially
  193. defaults to "/RTRIM".
  194.  
  195. "/RTRIM" removes all trailing spaces.  This is initially the default.
  196.  
  197. "/LTRIM" removes all leading spaces.  Initially defaults to "/RTRIM".
  198.  
  199. "/-TRIM" skips removing any leading or trailing spaces.
  200.  
  201. "/ZAPNULL" says to kill off any blank lines  found  in  the  file  (whether  the
  202. blanks were created by one of your  changes  or  not).   Initially  defaults  to
  203. "/-ZAPNULL".
  204.  
  205. "/-FIXBS" says to not resolve backspace characters.   By  default,  the  program
  206. resolves backspaces by removes pairs of characters and backspace characters  for
  207. you.  So "A", (BACKSPACE), "A", which  might  appear  as  overstriking  on  some
  208. printers, will come out as  just  a  single  "A".   "/FIXBS"  is  initially  the
  209. default.
  210.  
  211. "/-FIXTAB" says to not expand tab characters.  By default, the  program  figures
  212. that you have tab positions every 8 characters and expands the lines with spaces
  213. to make the tabs correspond to these  positions.   "/FIXTAB"  is  initially  the
  214. default.
  215.  
  216. "/EJECT=str" says to replace the page eject character (decimal 12) with  another
  217. string.  This replacement can be 0 characters (if you  say  "/EJECT=(NONE)"),  1
  218. character, or 2 or more characters.  The string can include  text,  decimal,  or
  219. hexadecimal  characters  (see  BRUCEHEX.DOC).   Any   /EJECT=str   specification
  220. overrides any specification in the character-translation tables.
  221.  
  222. "/Frptfile" specifies the file name to write out the results of this program to.
  223. By default, no report is created.  If you want one, however, it will include the
  224. date, time, and file name  being  processed  as  well  as  all  lines  that  had
  225. problems.  The file is appended to each time so it contains  a  running  log  of
  226. what you've run.  You can change this file name to something else  (and  provide
  227. drive and path information if desired) or you can say /-F and avoid creating the
  228. file altogether.
  229.  
  230. "/-F" says to skip producing the changed-line file entirely.  This is  initially
  231. the default.
  232.  
  233. "/-EOF" (vs "/EOF") says to not automatically add an  end-of-file  indicator  at
  234. the end of the output file.   By  default,  text  files  always  end  with  this
  235. character (decimal 26).
  236.  
  237.  
  238. FIXTEXT.DOC                          6                         Revised: 11-30-96
  239.  
  240. "/-EJECT" says to translate page eject characters (decimal 12) into spaces.   By
  241. default, page eject characters are left in the document.
  242.  
  243. "/MONO" (or "/-COLOR") does  not  try  to  override  screen  colors.   Initially
  244. defaults to "/COLOR".
  245.  
  246. "/COLOR" (or "/-MONO") allows screen colors to be overridden.  This is initially
  247. the default.
  248.  
  249. "/Iinitfile" says to read an initialization file with the file name  "initfile".
  250. The file specification *must* contain a period.  Initfiles are described in  the
  251. BRUCEINI.DOC file.  Initially defaults to "/IFIXTEXT.INI".
  252.  
  253. "/-I" (or "/INULL") says to skip loading  the  character-translation  table  and
  254. initialization file.  In this case, the default character-translation  table  is
  255. used.  See the "Character-translation table" discussion above.
  256.  
  257. "/Linitfile" says that the "Character-translation table" codes are  found  in  a
  258. file other than from the default "/Iinitfile" file.  This is primarily useful if
  259. you want to have a master *.INI file and a separate code lookup table.
  260.  
  261. "/-L" skips loading any character translation tables at all.  The  program  just
  262. does tab expansions and changing text formats (say, DOS  text  into  Unix  text)
  263. then.
  264.  
  265. "/Q" turns off the line-by-line status messages.
  266.  
  267. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  268.  
  269. "/?&H" gives you a hexadecimal and decimal conversion table.
  270.  
  271.  
  272.  
  273. FIXTEXT.DOC                          7                         Revised: 11-30-96
  274.  
  275. Return codes:
  276.  
  277. FIXTEXT returns the following ERRORLEVEL codes:
  278.         0 = no problems, changes made
  279.         1 = no problems, no changes made
  280.       249 = non-text file encountered despite /TEXT option
  281.       254 = program aborted
  282.       255 = syntax problems, file not found, or /? requested
  283.  
  284.  
  285. Author:
  286.  
  287. This program was written by Bruce Guthrie of Wayne Software.  It is free for use
  288. and redistribution provided relevant documentation is kept with the program,  no
  289. changes are made to the program or documentation, and it  is  not  bundled  with
  290. commercial programs or charged for separately.  People who need to bundle it  in
  291. for-sale packages must pay a $50 registration fee to  "Wayne  Software"  at  the
  292. following address.
  293.  
  294. Additional information about this and other Wayne Software programs can be found
  295. in the file BRUCE.DOC which should be included in the original  ZIP  file.   The
  296. recent change history for this  and  the  other  programs  is  provided  in  the
  297. HISTORY.ymm file which should be in the same ZIP file where "y" is  replaced  by
  298. the last digit of the year and "mm" is the  two  digit  month  of  the  release;
  299. HISTORY.611 came out in November 1996.  This same naming convention is  used  in
  300. naming the ZIP file (FIXTXymm.ZIP) that this program was included in.
  301.  
  302. Comments and suggestions can also be sent to:
  303.  
  304.                 Bruce Guthrie
  305.                 Wayne Software
  306.                 113 Sheffield St.
  307.                 Silver Spring, MD 20910
  308.  
  309.                 fax: (301) 588-8986
  310.                 e-mail: bguthrie@nmaa.org
  311.                 http://hjs.geol.uib.no/guthrie/
  312.  
  313. Please provide an Internet e-mail address on all correspondence.
  314.  
  315. 
  316.